package com.hz.ruoyiseller.api;

import com.hz.rouyigonggong.domain.LgSellerInfo;
import com.hz.ruoyiseller.service.LgSellerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author grx
 * @Classname SellerInfoAPI
 * @Description TODO
 * @Date 2025/3/10 17:19
 * @Version V1.0
 */
@RestController
@RequestMapping("/api")
public class SellerInfoAPI {
    @Autowired
    private LgSellerInfoService lgSellerInfoService;
    /**
    * @Description: 通过卖家id和商品id查询卖家信息
    * @Param: [sellerId, goodsId]
    * @return: com.hz.rouyigonggong.domain.LgSellerInfo
    * @Author: grx
    * @Date: 17:25 2025/3/10
    */
    @GetMapping("/getSellerInfoIdBySellerIdAndGoodsId")
    public LgSellerInfo getSellerInfoIdBySellerIdAndGoodsId(@RequestParam("sellerId")Integer sellerId,
                                                            @RequestParam("goodsId") Integer goodsId){
        return lgSellerInfoService.getSellerInfoIdBySellerIdAndGoodsId(sellerId,goodsId);
    }
    /**
    * @Description: 通过 lgSellerInfoid修改lgSellerInfo
    * @Param: [lgSellerInfo]
    * @return: int
    * @Author: grx
    * @Date: 17:25 2025/3/10
    */

    @PostMapping("/updateSellerInfo")
    public int updateSellerInfo(@RequestBody LgSellerInfo lgSellerInfo){
        return lgSellerInfoService.updateSellerInfo(lgSellerInfo);
    }
    //新增入库
    @PostMapping("/insertSellerInfo")
    public int insertSellerInfo(@RequestBody LgSellerInfo lgSellerInfo){
        return lgSellerInfoService.insertSellerInfo(lgSellerInfo);
    }

}
